<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class Comment extends Model
{
    protected $primaryKey = 'comment_id';
    protected $guarded = [];

    public function scopeRecent($query, $limit) {
        return $query->select(['comment_id', 'post_id', 'comment_content'])
            ->orderBy($column = 'comment_id', 'desc')
            ->limit($limit);
    }
}
